package com.cimpm.task.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.hby.common.annotation.Remind;
import com.hby.common.annotation.entity.AllowNull;
import com.hby.common.annotation.entity.AllowEdit;
import com.hby.common.annotation.entity.Pattern;
import com.hby.common.annotation.entity.VerifyRepetitionField;
import com.hby.common.typeHandler.DateTypeHandler;

import java.util.Date;

@TableName("task_task_flow")
public class TaskFlow {

    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

	@TableField(value = "`name`")
    @VerifyRepetitionField
    @AllowEdit
	private String name;

	@Remind("0:发布型（发布给其他人进行流程）,1:自发型（有自己开始流程）")
    @TableField(value = "`type`")
	private Integer type;

    @TableField(value = "`creator`")
    @AllowNull
    private String creator;

	@TableField(value = "`permission_role_id`")
    @Pattern("^\\d+(\\,\\d+)*$")
    @AllowEdit
	private String permissionRoleId;

    @TableField(typeHandler = DateTypeHandler.class,value = "`create_time`")
    private String createTime;

    @AllowNull
    @TableField(value = "`description`")
    @AllowEdit
    private String description;

    @TableLogic
    @TableField(value = "`is_deleted`")
    private Date isDeleted;

    @Version
    @TableField(value = "`version`")
    private Integer version;

    public Integer getId() { return id; }

    public void setId(Integer id) { this.id = id; }

    public String getName() { return name; }

    public void setName(String name) { this.name = name; }

    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    public String getCreator() { return creator; }

    public void setCreator(String creator) { this.creator = creator; }

    public String getPermissionRoleId() { return permissionRoleId; }

    public void setPermissionRoleId(String permissionRoleId) { this.permissionRoleId = permissionRoleId; }

    public String getCreateTime() {
        return createTime;
    }

    public void setCreateTime(String createTime) {
        this.createTime = createTime;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public Date getIsDeleted() { return isDeleted; }

    public void setIsDeleted(Date isDeleted) { this.isDeleted = isDeleted; }

    public Integer getVersion() { return version; }

    public void setVersion(Integer version) { this.version = version; }

    @Override
    public String toString() {
        return "TaskFlow{" + "id=" + id + ", name='" + name + '\'' + ", type=" + type + ", creator='" + creator + '\'' + ", permissionRoleId='" + permissionRoleId + '\'' + ", createTime='" + createTime + '\'' + ", description='" + description + '\'' + ", isDeleted=" + isDeleted + ", version=" + version + '}';
    }
}
